package com.example.demo.Service.impl;

import com.example.demo.Dao.DiseaseMapper;
import com.example.demo.Entity.Disease;
import com.example.demo.Service.DiseaseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DiseaseServiceImpl implements DiseaseService {
    @Autowired
    private DiseaseMapper diseaseMapper;

    @Override
    public List<Disease> findall() {
        return diseaseMapper.findall();
    }

    @Override
    public PageInfo<Disease> findPageByName(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Disease> list=diseaseMapper.findall();
        PageInfo<Disease> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }
}
